package com.lboyang.mapper;

import com.lboyang.entity.Payment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description:
 * @Author: Aiguodala
 * @CreateDate: 2021/4/24 16:55
 */

@Mapper
public interface PaymentMapper {

    /**
     * 保存订单
     * @param payment
     * @return
     */
    @Insert("insert into payment(serial) values (#{serial})")
    int save(Payment payment);

    /**
     * 通过id获取订单
     * @param id
     * @return
     */
    @Select("select id,serial from payment where id = #{id}")
    Payment getById(Long id);
}
